﻿using System;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x02000FFA RID: 4090
	internal class Process_PtcG2C_EnterSceneNtf
	{
		// Token: 0x0600D48F RID: 54415 RVA: 0x0032191C File Offset: 0x0031FB1C
		public static void Process(PtcG2C_EnterSceneNtf roPtc)
		{
			XSingleton<XClientNetwork>.singleton.XLoginStep = XLoginStep.Playing;
            //zcg XHeroBattleDocument.LoadSkillHandler = roPtc.Data.canMorph;
            KKSG.SceneCfg sceneCfg = roPtc.Data;
            {
                string outString = string.Format("SceneCfg -> SceneID:{0}, SyncMode:{1}, ownerID:{2},isWatcher:{3},canMorph:{4}", sceneCfg.SceneID, sceneCfg.SyncMode, sceneCfg.ownerID, sceneCfg.isWatcher, sceneCfg.canMorph);
                XSingleton<XDebug>.singleton.AddWarningLog(outString);
                outString = "enemyWaves:";
                XSingleton<XDebug>.singleton.AddWarningLog(outString);
                foreach(var v in roPtc.Data.enemyWaves)
                {
                    outString = string.Format("UnitAppearance -> uID:{0}, unitName:{1}, unitType:{2}", v.uID, v.unitName, v.unitType);
                    XSingleton<XDebug>.singleton.AddWarningLog(outString);
                }
                outString = "doodads:";
                XSingleton<XDebug>.singleton.AddWarningLog(outString);
                foreach (var v in roPtc.Data.doodads)
                {
                    outString = string.Format("DoodadInfo -> waveid:{0}, type:{1}, id:{2}, count:{3}", v.waveid, v.type, v.id, v.count);
                    XSingleton<XDebug>.singleton.AddWarningLog(outString);
                }
                outString = "preloadEnemyIDs:";
                XSingleton<XDebug>.singleton.AddWarningLog(outString);
                foreach (var v in roPtc.Data.preloadEnemyIDs)
                {
                    outString = string.Format("preloadEnemyID -> id:{0}", v);
                    XSingleton<XDebug>.singleton.AddWarningLog(outString);
                }
            }
            bool sceneReady = XSingleton<XScene>.singleton.SceneReady;
			if (sceneReady)
			{
				XSingleton<XScene>.singleton.SceneEnterTo(roPtc.Data, true);
			}
			else
			{
				XSingleton<XScene>.singleton.StoreSceneConfig(roPtc.Data);
			}
		}
	}
}
